package com.jgybzx.entity;

import java.io.Serializable;

/**
 * @author Jgybzx
 * @date 2021/7/30 14:21
 * des
 */
public class Permission implements Serializable {
    private Integer permissionId;

    private String remark;

    private String permissionName;

    private static final long serialVersionUID = 1L;

    public Permission(Integer permissionId, String remark, String permissionName) {
        this.permissionId = permissionId;
        this.remark = remark;
        this.permissionName = permissionName;
    }

    public Permission() {
        super();
    }

    public Integer getPermissionId() {
        return permissionId;
    }

    public void setPermissionId(Integer permissionId) {
        this.permissionId = permissionId;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark == null ? null : remark.trim();
    }

    public String getPermissionName() {
        return permissionName;
    }

    public void setPermissionName(String permissionName) {
        this.permissionName = permissionName == null ? null : permissionName.trim();
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", permissionId=").append(permissionId);
        sb.append(", remark=").append(remark);
        sb.append(", permissionName=").append(permissionName);
        sb.append("]");
        return sb.toString();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof Permission)) {
            return false;
        }

        Permission that = (Permission) o;

        if (getPermissionId() != null ? !getPermissionId().equals(that.getPermissionId()) : that.getPermissionId() != null) {
            return false;
        }
        if (getRemark() != null ? !getRemark().equals(that.getRemark()) : that.getRemark() != null) {
            return false;
        }
        return getPermissionName() != null ? getPermissionName().equals(that.getPermissionName()) : that.getPermissionName() == null;
    }

    @Override
    public int hashCode() {
        int result = getPermissionId() != null ? getPermissionId().hashCode() : 0;
        result = 31 * result + (getRemark() != null ? getRemark().hashCode() : 0);
        result = 31 * result + (getPermissionName() != null ? getPermissionName().hashCode() : 0);
        return result;
    }
}